#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/hash_policy.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define ps putchar(' ')
#define pe putchar('\n')
#define int long long
#define eb emplace_back
#define pi pair<int, int>
#define mk make_pair
#define fi first
#define se second
#define Ad tr[p].ad
// #define Ad t[p].ad
#define ls p << 1
#define rs p << 1 | 1
// #define ls tr[p].son[0]
// #define rs tr[p].son[1]
// #define ls t[p].son[0]
// #define rs t[p].son[1]
#define len (r - l + 1)
#define mid ((l + r) >> 1)
using namespace std;
// using namespace __gnu_pbds
inline int read()
{
    int f = 0, ans = 0;
    char c = getchar();
    while (!isdigit(c))
        f |= c == '-', c = getchar();
    while (isdigit(c))
        ans = (ans << 3) + (ans << 1) + c - 48, c = getchar();
    return f ? -ans : ans;
}
void write(int x)
{
    if (x < 0)
        putchar('-'), x = -x;
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
const int inf = 1e18, mod = 998244353;
// f_j_i : s-i-th t-j-th
int n, m;
string s, t;
namespace medium {
	const int N=2e3+5, M=2e3+5;
	bool f[M][N]; int lst[M][N];
	inline void main() {
		f[0][0]=1;
		for(int j=1;j<=m;++j)
			for(int i=1, p=0;i<=n;++i) {
				if(p<i-1 && s[p+1]!=s[i-1])	p=i-2;
				while(p<i && !f[j-1][p])	++p;
				if(p<i && s[i]==t[j])	f[j][i]=1, lst[j][i]=p;
			}
		auto output=[]() {
			s+=s[n];
			for(int i=n;i;--i) {
				if(f[m][i]) {
					cout<<"YES\n";
					vector<int> ans;
					for(int j=m;j;--j)	ans.eb(i), i=lst[j][i];
					reverse(begin(ans), end(ans));
					for(int k:ans)	cout<<k<<' ';
					return 1;
				}
				if(s[i]!=s[i+1])	break;
			}
			return 0;
		};
		if(!output())	cout<<"NO";
	}
}
namespace lg_sml {
	const int N=1e5+5, M=2e1+5;
	bool f[M][N]; int lst[M][N];
	inline void main() {
		f[0][0]=1;
		for(int j=1;j<=m;++j)
			for(int i=1, p=0;i<=n;++i) {
				if(p<i-1 && s[p+1]!=s[i-1])	p=i-2;
				while(p<i && !f[j-1][p])	++p;
				if(p<i && s[i]==t[j])	f[j][i]=1, lst[j][i]=p;
			}
		auto output=[]() {
			s+=s[n];
			for(int i=n;i;--i) {
				if(f[m][i]) {
					cout<<"YES\n";
					vector<int> ans;
					for(int j=m;j;--j)	ans.eb(i), i=lst[j][i];
					reverse(begin(ans), end(ans));
					for(int k:ans)	cout<<k<<' ';
					return 1;
				}
				if(s[i]!=s[i+1])	break;
			}
			return 0;
		};
		if(!output())	cout<<"NO";
	}
}
namespace B {
	inline void main() {
		s+=' ';
		vector<int> ans;
		for(int i=1, p=1;i<=m;++i) {
			while(p<=n && s[p]!=t[i])	++p;
			while(p<=n && s[p]==s[p+1])	++p;
			if(p>n) { cout<<"NO"; return; }
			ans.eb(p);
		}
		cout<<"YES\n";
		for(int k:ans)	cout<<k<<' ';
	}
	inline bool check() {
		for(int i=1;i<m;++i)
			if(t[i]==t[i+1])	return 0;
		main();
		return 1;
	}
}
signed main()
{
    freopen("seq.in", "r", stdin);
    freopen("seq.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin>>s>>t;
	n=s.size(), m=t.size();
	s=' '+s, t=' '+t;
	if(n<=2e3 && m<=2e3) { medium::main(); return 0; }
	if(n<=1e5 && m<=2e1) { lg_sml::main(); return 0; }
	if(B::check())	return 0;
    return 0;
}
